/**
 * Copyright 2009 Henning Teek, Ingo Renner
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.googlecode.bricket.web.plugin;

import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

import brix.registry.ExtensionPoint;

/**
 * Plugin that handles services of certain type. This is not a global plugin, the
 * scope if this plugin is {@link ServicesPlugin}.
 * 
 * @author Henning Teek
 */
public interface ServicePlugin {
	public static ExtensionPoint<ServicePlugin> POINT = new ExtensionPoint<ServicePlugin>() {
		public brix.registry.ExtensionPoint.Multiplicity getMultiplicity() {
			return Multiplicity.COLLECTION;
		}

		public String getUuid() {
			return ServicePlugin.class.getName();
		}
	};

	/**
	 * Returns the service type of this plugin.
	 * @return
	 */
	String getServiceType();

	/**
	 * Returns the name of this plugin.
	 * @return
	 */
	String getName();

	/**
	 * Returns model caption of manage link for this plugin.
	 * @return
	 */
	public IModel<String> newServiceCaptionModel();

	/**
	 * Returns an instance of panel that should manage the service of this plugin.
	 * @param id panel component id
	 * @return panel instance
	 */
	Panel newServicePanel(String id);
}
